package fr.utbm;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MedecinList {

	private List<Medecin> medecins;
	
	public MedecinList() {
		medecins = new ArrayList<Medecin>();
	}
	
	public void addMedecin(Medecin p) {
		medecins.add(p);
        Collections.sort(medecins);
	}
	
	public List<Medecin> getMedecins() {
		return medecins;
	}

	public int indexOf(Patient p) {
		return medecins.indexOf(p);
	}

	public int size() {
		return medecins.size();
	}

	public Medecin get(int index) {
		return medecins.get(index);
	}

	public void addMedecin(User user) {
		Medecin m = new Medecin(user.getId(), user.getUsername(), user.getPassword(),
				user.getType(), user.getProfil_nom(), user.getProfil_prenom(), 
				user.getProfil_age(), user.getProfil_taille(), 
				user.getProfil_photo_url());
		addMedecin(m);
	}

}
